<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::util::sync_io::Asio_waitable_native_handle Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Public API.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1util.html">util</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1util_1_1sync__io.html">sync_io</a></li><li class="navelem"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipc::util::sync_io::Asio_waitable_native_handle Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Useful if using the <code><a class="el" href="namespaceipc_1_1util_1_1sync__io.html" title="Contains common code, as well as important explanatory documentation in the following text,...">sync_io</a></code> pattern within a user event loop built on boost.asio (optionally with flow.async help), an object of this class wraps a non-null <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> and allows one to use <code>.async_wait()</code> to perform event waiting on behalf of any <code><a class="el" href="namespaceipc_1_1util_1_1sync__io.html" title="Contains common code, as well as important explanatory documentation in the following text,...">sync_io</a></code>-implementing <a class="el" href="namespaceipc_1_1transport.html" title="Flow-IPC module providing transmission of structured messages and/or low-level blobs (and more) betwe...">ipc::transport</a> or <a class="el" href="namespaceipc_1_1session.html" title="Flow-IPC module providing the broad lifecycle and shared-resource organization – via the session conc...">ipc::session</a> object.  
 <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#details">More...</a></p>

<p><code>#include &lt;asio_waitable_native_hndl.hpp&gt;</code></p>

<p>Inherits boost::asio::posix::descriptor.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a4cbb287f5971162e747f475052abc413"><td class="memItemLeft" align="right" valign="top"><a id="a4cbb287f5971162e747f475052abc413" name="a4cbb287f5971162e747f475052abc413"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>Base</b> = boost::asio::posix::descriptor</td></tr>
<tr class="memdesc:a4cbb287f5971162e747f475052abc413"><td class="mdescLeft">&#160;</td><td class="mdescRight">Short-hand for our base type; can be used for, e.g., <code>Base::wait_write</code> and <code>Base::wait_read</code>. <br /></td></tr>
<tr class="separator:a4cbb287f5971162e747f475052abc413"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a43d1c463dc07cacfaacdb2b53c020d0d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a43d1c463dc07cacfaacdb2b53c020d0d">Asio_waitable_native_handle</a> (const Base::executor_type &amp;ex, <a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a> hndl)</td></tr>
<tr class="memdesc:a43d1c463dc07cacfaacdb2b53c020d0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct boost.asio descriptor object such that one can <code>async_wait()</code> events on the given non-<code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a43d1c463dc07cacfaacdb2b53c020d0d">More...</a><br /></td></tr>
<tr class="separator:a43d1c463dc07cacfaacdb2b53c020d0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9718ec7e1efc2ad42e6bd7c009906680"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a9718ec7e1efc2ad42e6bd7c009906680">Asio_waitable_native_handle</a> (const Base::executor_type &amp;ex)</td></tr>
<tr class="memdesc:a9718ec7e1efc2ad42e6bd7c009906680"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct boost.asio descriptor object that stores no handle.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a9718ec7e1efc2ad42e6bd7c009906680">More...</a><br /></td></tr>
<tr class="separator:a9718ec7e1efc2ad42e6bd7c009906680"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a472c5765986639fce07e478e660edb25"><td class="memTemplParams" colspan="2">template&lt;typename Execution_context &gt; </td></tr>
<tr class="memitem:a472c5765986639fce07e478e660edb25"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a472c5765986639fce07e478e660edb25">Asio_waitable_native_handle</a> (Execution_context &amp;context, <a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a> hndl, typename std::enable_if_t&lt; std::is_convertible_v&lt; Execution_context &amp;, boost::asio::execution_context &amp; &gt; &gt; *ignored=nullptr)</td></tr>
<tr class="memdesc:a472c5765986639fce07e478e660edb25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct boost.asio descriptor object such that one can <code>async_wait()</code> events on the given non-<code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a472c5765986639fce07e478e660edb25">More...</a><br /></td></tr>
<tr class="separator:a472c5765986639fce07e478e660edb25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7310dda2ba43a9e33eff154a8697d0c"><td class="memTemplParams" colspan="2">template&lt;typename Execution_context &gt; </td></tr>
<tr class="memitem:aa7310dda2ba43a9e33eff154a8697d0c"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#aa7310dda2ba43a9e33eff154a8697d0c">Asio_waitable_native_handle</a> (Execution_context &amp;context, typename std::enable_if_t&lt; std::is_convertible_v&lt; Execution_context &amp;, boost::asio::execution_context &amp; &gt; &gt; *ignored=nullptr)</td></tr>
<tr class="memdesc:aa7310dda2ba43a9e33eff154a8697d0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct boost.asio descriptor object that stores no handle.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#aa7310dda2ba43a9e33eff154a8697d0c">More...</a><br /></td></tr>
<tr class="separator:aa7310dda2ba43a9e33eff154a8697d0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa19dd114ab82118dc1f100d07583b106"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#aa19dd114ab82118dc1f100d07583b106">Asio_waitable_native_handle</a> (<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp;&amp;src)</td></tr>
<tr class="memdesc:aa19dd114ab82118dc1f100d07583b106"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move-construct.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#aa19dd114ab82118dc1f100d07583b106">More...</a><br /></td></tr>
<tr class="separator:aa19dd114ab82118dc1f100d07583b106"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e987cbc14f210607f39d06495c275b0"><td class="memItemLeft" align="right" valign="top"><a id="a3e987cbc14f210607f39d06495c275b0" name="a3e987cbc14f210607f39d06495c275b0"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>~Asio_waitable_native_handle</b> ()</td></tr>
<tr class="memdesc:a3e987cbc14f210607f39d06495c275b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor that does <em>not</em> OS-close (<code>"::close()"</code>) the stored native handle (if any) but rather performs <code>this-&gt;release()</code> (eating any potential error in doing so). <br /></td></tr>
<tr class="separator:a3e987cbc14f210607f39d06495c275b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae38328d6ef63942c3539f7b17b0108da"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ae38328d6ef63942c3539f7b17b0108da">operator=</a> (<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp;&amp;src)</td></tr>
<tr class="memdesc:ae38328d6ef63942c3539f7b17b0108da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move-assign.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ae38328d6ef63942c3539f7b17b0108da">More...</a><br /></td></tr>
<tr class="separator:ae38328d6ef63942c3539f7b17b0108da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6663616504b4543a6227eb21279ce39"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39">native_handle</a> ()</td></tr>
<tr class="memdesc:ad6663616504b4543a6227eb21279ce39"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the same <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> as passed to original handle-loading ctor or <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a>, whichever happened last; or <code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>, if neither has been invoked, or release() was invoked more recently than either.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39">More...</a><br /></td></tr>
<tr class="separator:ad6663616504b4543a6227eb21279ce39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d28277f9ef090032b0483c65f79f23c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c">assign</a> (<a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a> hndl)</td></tr>
<tr class="memdesc:a7d28277f9ef090032b0483c65f79f23c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads value to be returned by <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39" title="Returns the same Native_handle as passed to original handle-loading ctor or assign(),...">native_handle()</a>.  <a href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c">More...</a><br /></td></tr>
<tr class="separator:a7d28277f9ef090032b0483c65f79f23c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Useful if using the <code><a class="el" href="namespaceipc_1_1util_1_1sync__io.html" title="Contains common code, as well as important explanatory documentation in the following text,...">sync_io</a></code> pattern within a user event loop built on boost.asio (optionally with flow.async help), an object of this class wraps a non-null <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> and allows one to use <code>.async_wait()</code> to perform event waiting on behalf of any <code><a class="el" href="namespaceipc_1_1util_1_1sync__io.html" title="Contains common code, as well as important explanatory documentation in the following text,...">sync_io</a></code>-implementing <a class="el" href="namespaceipc_1_1transport.html" title="Flow-IPC module providing transmission of structured messages and/or low-level blobs (and more) betwe...">ipc::transport</a> or <a class="el" href="namespaceipc_1_1session.html" title="Flow-IPC module providing the broad lifecycle and shared-resource organization – via the session conc...">ipc::session</a> object. </p>
<p >If boost.asio integration is not the goal, it can at least act as a mere container of a <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>. <code><a class="el" href="namespaceipc_1_1util_1_1sync__io.html" title="Contains common code, as well as important explanatory documentation in the following text,...">sync_io</a></code> pattern uses <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html" title="Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...">Asio_waitable_native_handle</a> in either capacity. If you're familiar with boost.asio POSIX <code>descriptor</code>, then you're familiar with this class.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="namespaceipc_1_1util_1_1sync__io.html#aa0b9a3cc6bdc7dedbef4f9e06851aa24" title="In sync_io pattern, concrete type storing user-supplied function invoked by pattern-implementing ipc:...">sync_io::Event_wait_func</a> doc header; and specifically section "Integrating with boost.asio." It provides context and rationale for this guy when used for <code>.async_wait()</code>.</dd></dl>
<p>It may also be useful in its own right independently.</p>
<p >In any case use is quite straightforward:</p><ol type="1">
<li>Construct from a non-null, opened w/r/t kernel <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> &ndash; and an executor/execution context (typically a <code>Task_engine</code> or possibly boost.asio <code>strand</code>). (If boost.asio integration is not the goal, then any blank/otherwise-unused <code>Task_engine</code> is fine.)<ol type="a">
<li>(Optional) If the wrapped handle is unknown at construction time, use the 1-arg ctor form; then <code>.<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a></code> it when it is known.</li>
</ol>
</li>
<li>Invoke <code>.async_wait()</code> (from <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a4cbb287f5971162e747f475052abc413" title="Short-hand for our base type; can be used for, e.g., Base::wait_write and Base::wait_read.">Asio_waitable_native_handle::Base</a> a/k/a <code>boost::asio::posix::descriptor</code>) as many times as desired.<ul>
<li>And/or invoke accessor <code>.<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39" title="Returns the same Native_handle as passed to original handle-loading ctor or assign(),...">native_handle()</a></code> to re-obtain the wrapped handle as desired.</li>
</ul>
</li>
<li>Destroy when no more <code>.async_wait()</code>ing or <code>.<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39" title="Returns the same Native_handle as passed to original handle-loading ctor or assign(),...">native_handle()</a></code> access is necessary.<ol type="a">
<li><code>.release()</code> may be used to essentially nullify a <code>*this</code>. This may be desirable for cleanliness in some situations.</li>
</ol>
</li>
</ol>
<p >You may not use <code>*this</code> object directly to perform actual I/O; it lacks such methods as <code>async_read_some()</code>. Moreover it is likely against the (informal) aim of <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html" title="Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...">Asio_waitable_native_handle</a> to perform actual I/O by obtaining the handle via <code>.<a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39" title="Returns the same Native_handle as passed to original handle-loading ctor or assign(),...">native_handle()</a></code> and then doing reads/writes on that handle.</p>
<p >Construction is likely performed by internal Flow-IPC code only in practice, though you are free to use it for your own purposes.</p>
<dl class="section warning"><dt>Warning</dt><dd>This object, like <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a4cbb287f5971162e747f475052abc413" title="Short-hand for our base type; can be used for, e.g., Base::wait_write and Base::wait_read.">Asio_waitable_native_handle::Base</a>, isn't <em>just</em> a <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> wrapper: It also has to be associated with an execution context, usually <code>Task_engine</code> (<code>boost::asio::io_context</code>) or boost.asio strand. If you associate, via ctor or <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a>, 2 <code>*this</code>es each wrapping the same-valued <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> (storing the same raw handle) with the same <code>Task_engine</code>, behavior is undefined formally; though internally it'll cause a duplicate-descriptor error/exception (in Linux from <code>errno == EEXIST</code> from an internal <code>epoll_ctl()</code>). Even if you don't plan to <code>async_wait()</code>, this will unfortunately still happen; and for <code>async_wait()</code> purposes it will and <em>should</em> happen. So just take care not to create duplicate-handle <code>*this</code>es associated with the same <code>Task_engine</code>. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>Move assignment works which can be useful to associate a <code>*this</code> with a different execution context (event loop, <code>Task_engine</code>, etc.).</dd></dl>
<h3>Rationale for <code>protected</code> rather than <code>public</code> inheritance</h3>
<p ><code>public</code> inheritance would have been fine, more or less, but it seemed prudent to close off access to mutators from <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a4cbb287f5971162e747f475052abc413" title="Short-hand for our base type; can be used for, e.g., Base::wait_write and Base::wait_read.">Asio_waitable_native_handle::Base</a> like <code>close()</code> and <code>non_blocking()</code> which could sow sheer chaos; the point here is to watch for events on this guy, not (e.g.) blow up some internal transport within <a class="el" href="classipc_1_1transport_1_1Native__socket__stream.html" title="Implements both Native_handle_sender and Native_handle_receiver concepts by using a stream-oriented U...">transport::Native_socket_stream</a> et al. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a43d1c463dc07cacfaacdb2b53c020d0d" name="a43d1c463dc07cacfaacdb2b53c020d0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43d1c463dc07cacfaacdb2b53c020d0d">&#9670;&nbsp;</a></span>Asio_waitable_native_handle() <span class="overload">[1/5]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::sync_io::Asio_waitable_native_handle::Asio_waitable_native_handle </td>
          <td>(</td>
          <td class="paramtype">const Base::executor_type &amp;&#160;</td>
          <td class="paramname"><em>ex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a>&#160;</td>
          <td class="paramname"><em>hndl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct boost.asio descriptor object such that one can <code>async_wait()</code> events on the given non-<code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>. </p>
<p >The handle must be a valid (not closed) handle (descriptor, FD).</p>
<p >Consider also the 1-arg ctor variant which stores no handle; followed by <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ex</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
    <tr><td class="paramname">hndl</td><td>The handle that might be watched subsequently. <code>.null()</code> leads to undefined behavior; assertion may trip. If the associated <code>Task_engine</code> is already associated with another <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html" title="Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...">Asio_waitable_native_handle</a> (or other I/O object) that stores the same <a class="el" href="structipc_1_1util_1_1Native__handle.html#ab2f496740139c5752a25a30cf3325d86" title="The native handle (possibly equal to S_NULL_HANDLE), the exact payload of this Native_handle.">Native_handle::m_native_handle</a>, it is formally undefined behavior (in reality a boost.asio exception is thrown; but just don't do it). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9718ec7e1efc2ad42e6bd7c009906680" name="a9718ec7e1efc2ad42e6bd7c009906680"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9718ec7e1efc2ad42e6bd7c009906680">&#9670;&nbsp;</a></span>Asio_waitable_native_handle() <span class="overload">[2/5]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::sync_io::Asio_waitable_native_handle::Asio_waitable_native_handle </td>
          <td>(</td>
          <td class="paramtype">const Base::executor_type &amp;&#160;</td>
          <td class="paramname"><em>ex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct boost.asio descriptor object that stores no handle. </p>
<p >You may call <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a> to change this.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ex</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a472c5765986639fce07e478e660edb25" name="a472c5765986639fce07e478e660edb25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a472c5765986639fce07e478e660edb25">&#9670;&nbsp;</a></span>Asio_waitable_native_handle() <span class="overload">[3/5]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Execution_context &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::sync_io::Asio_waitable_native_handle::Asio_waitable_native_handle </td>
          <td>(</td>
          <td class="paramtype">Execution_context &amp;&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a>&#160;</td>
          <td class="paramname"><em>hndl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::enable_if_t&lt; std::is_convertible_v&lt; Execution_context &amp;, boost::asio::execution_context &amp; &gt; &gt; *&#160;</td>
          <td class="paramname"><em>ignored</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct boost.asio descriptor object such that one can <code>async_wait()</code> events on the given non-<code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>. </p>
<p >The handle must be a valid (not closed) handle (descriptor, FD).</p>
<p >Consider also the 1-arg ctor variant which stores no handle; followed by <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Execution_context</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
    <tr><td class="paramname">hndl</td><td>The handle that might be watched subsequently. <code>.null()</code> leads to undefined behavior; assertion may trip. If the associated <code>Task_engine</code> is already associated with another <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html" title="Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...">Asio_waitable_native_handle</a> that stores the same <a class="el" href="structipc_1_1util_1_1Native__handle.html#ab2f496740139c5752a25a30cf3325d86" title="The native handle (possibly equal to S_NULL_HANDLE), the exact payload of this Native_handle.">Native_handle::m_native_handle</a>, it is formally undefined behavior (in reality a boost.asio exception is thrown; but just don't do it). </td></tr>
    <tr><td class="paramname">ignored</td><td>Disregard. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa7310dda2ba43a9e33eff154a8697d0c" name="aa7310dda2ba43a9e33eff154a8697d0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7310dda2ba43a9e33eff154a8697d0c">&#9670;&nbsp;</a></span>Asio_waitable_native_handle() <span class="overload">[4/5]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Execution_context &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::sync_io::Asio_waitable_native_handle::Asio_waitable_native_handle </td>
          <td>(</td>
          <td class="paramtype">Execution_context &amp;&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::enable_if_t&lt; std::is_convertible_v&lt; Execution_context &amp;, boost::asio::execution_context &amp; &gt; &gt; *&#160;</td>
          <td class="paramname"><em>ignored</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct boost.asio descriptor object that stores no handle. </p>
<p >You may call <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a> to change this.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Execution_context</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
    <tr><td class="paramname">ignored</td><td>Disregard. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa19dd114ab82118dc1f100d07583b106" name="aa19dd114ab82118dc1f100d07583b106"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa19dd114ab82118dc1f100d07583b106">&#9670;&nbsp;</a></span>Asio_waitable_native_handle() <span class="overload">[5/5]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::sync_io::Asio_waitable_native_handle::Asio_waitable_native_handle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move-construct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> ctor. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7d28277f9ef090032b0483c65f79f23c" name="a7d28277f9ef090032b0483c65f79f23c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d28277f9ef090032b0483c65f79f23c">&#9670;&nbsp;</a></span>assign()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ipc::util::sync_io::Asio_waitable_native_handle::assign </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a>&#160;</td>
          <td class="paramname"><em>hndl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loads value to be returned by <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#ad6663616504b4543a6227eb21279ce39" title="Returns the same Native_handle as passed to original handle-loading ctor or assign(),...">native_handle()</a>. </p>
<p >As with the 2+-arg ctor(s) the handle must be valid (not closed). See also <code>.release()</code> and dtor.</p>
<p >If a handle is already loaded (<code>Base::is_open() == true</code>), this method automatically release()s it first.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hndl</td><td>The handle that might be watched subsequently. <code>.null()</code> leads to undefined behavior; assertion may trip. If the associated <code>Task_engine</code> is already associated with another <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html" title="Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...">Asio_waitable_native_handle</a> that stores the same <a class="el" href="structipc_1_1util_1_1Native__handle.html#ab2f496740139c5752a25a30cf3325d86" title="The native handle (possibly equal to S_NULL_HANDLE), the exact payload of this Native_handle.">Native_handle::m_native_handle</a>, it is formally undefined behavior (in reality a boost.asio exception is thrown; but just don't do it). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad6663616504b4543a6227eb21279ce39" name="ad6663616504b4543a6227eb21279ce39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6663616504b4543a6227eb21279ce39">&#9670;&nbsp;</a></span>native_handle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structipc_1_1util_1_1Native__handle.html">Native_handle</a> ipc::util::sync_io::Asio_waitable_native_handle::native_handle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the same <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a> as passed to original handle-loading ctor or <a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html#a7d28277f9ef090032b0483c65f79f23c" title="Loads value to be returned by native_handle().">assign()</a>, whichever happened last; or <code>.null()</code> <a class="el" href="structipc_1_1util_1_1Native__handle.html" title="A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.">Native_handle</a>, if neither has been invoked, or release() was invoked more recently than either. </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="ae38328d6ef63942c3539f7b17b0108da" name="ae38328d6ef63942c3539f7b17b0108da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae38328d6ef63942c3539f7b17b0108da">&#9670;&nbsp;</a></span>operator=()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp; ipc::util::sync_io::Asio_waitable_native_handle::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classipc_1_1util_1_1sync__io_1_1Asio__waitable__native__handle.html">Asio_waitable_native_handle</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move-assign. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>See boost.asio docs for similar <code>posix::basic_descriptor</code> method. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>See boost.asio docs for similar <code>posix::basic_descriptor</code> method. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>util/sync_io/<a class="el" href="asio__waitable__native__hndl_8hpp.html">asio_waitable_native_hndl.hpp</a></li>
<li>util/sync_io/<a class="el" href="asio__waitable__native__hndl_8cpp.html">asio_waitable_native_hndl.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:23 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
